/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.persistentie;

import Server.domain.items.Boots;
import Server.domain.items.ChestArmor;
import Server.domain.items.Gloves;
import Server.domain.items.Helmet;
import Server.domain.items.Item;
import Server.domain.items.ItemAttribute;
import Server.domain.items.ItemAttributeType;
import Server.domain.items.LegArmor;
import Server.domain.items.MeleeWeapon;
import Server.domain.items.Necklace;
import Server.domain.Player;
import Server.domain.items.RangedWeapon;
import Server.domain.items.Ring;
import Server.domain.User;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;


/**
 *
 * @author Sander
 */
public class UserFactory {
    //String usrnm, String pw, String fn, String ln, String mail
    
    List<User> users = new ArrayList<User>();
    
    public UserFactory(){
        User jeff = new User("Kite", "leet", "pro", "player", "omg.thats@right.com");
        
        User joff = new User("r", "r", "ama", "gashed", "oh.ye@own.com");
        Player p = new Player("ripper the player");
        Player p1 = new Player("ripper the second");
        Player p2 = new Player("ripper the third");
        joff.addPlayer(p);
        joff.addPlayer(p1);
        joff.addPlayer(p2);
        p.addExperience(150);
        p.addExperience(500000);
        List<ItemAttribute> attributes = new ArrayList<ItemAttribute>();
        attributes.add(new ItemAttribute(ItemAttributeType.CRITDAMAGE, 2));
        p.equip(new Helmet("helmet", 0, 100000, 1337, 1447, attributes));
        List<ItemAttribute> attributes2 = new ArrayList<ItemAttribute>();
        attributes2.add(new ItemAttribute(ItemAttributeType.CRITCHANCE, 0.25));
        attributes2.add(new ItemAttribute(ItemAttributeType.ATTACKSPEED, 500));
        p.equip(new MeleeWeapon("Test Weapon", 10, 100002, 55, 0, 0, 50, 45, false, attributes2));
        p1.spendLevelUpAttributePoint(0);
        joff.setSelectedPlayerIndex(0);
        
        for(int a = 0; a < 5; a ++)
        {
            if(a == 2)
            {
                List<ItemAttribute> attributes3 = new ArrayList<ItemAttribute>();
                attributes3.add(new ItemAttribute(ItemAttributeType.MAXHP, 69));
                LegArmor la = new LegArmor("sexypants", 20, 100003, 24, 34, attributes3);
                p.addItem(la);
                
                List<ItemAttribute> attributes4 = new ArrayList<ItemAttribute>();
                attributes4.add(new ItemAttribute(ItemAttributeType.MAXHP, 666));
                LegArmor la2 = new LegArmor("sexualpants", 20, 100004, 24, 35, attributes4);
                p.addItem(la2);
                
                List<ItemAttribute> attributes5 = new ArrayList<ItemAttribute>();
                attributes5.add(new ItemAttribute(ItemAttributeType.CRITCHANCE, 0.05));
                Gloves gl = new Gloves("sharp fingernails", 20, 100005, 24, 35, attributes5);
                p.addItem(gl);
                
                Gloves gl2 = new Gloves("oven mits", 20, 100006, 2, 75, new ArrayList<ItemAttribute>());
                p.addItem(gl2);
                
                Ring r1 = new Ring("sapphire ring", 1000, 100007, 1, 1, new ArrayList<ItemAttribute>());
                Ring r2 = new Ring("ruby ring", 1000, 100008, 1, 1, new ArrayList<ItemAttribute>());
                Ring r3 = new Ring("emerald ring", 1000, 100009, 1, 1, new ArrayList<ItemAttribute>());
                Ring r4 = new Ring("amethyst ring", 1000, 100010, 1, 1, new ArrayList<ItemAttribute>());
                r1.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.MPREGEN, 0.1));
                r2.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.HPREGEN, 0.1));
                r3.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.SPREGEN, 0.1));
                r4.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.MAXHP, 25));
                r4.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.MAXSP, 25));
                r4.addEquipmentAttribute(new ItemAttribute(ItemAttributeType.MAXMP, 25));
                p.addItem(r1);
                p.addItem(r2);
                p.addItem(r3);
                p.addItem(r4);
                
                Boots b1 = new Boots("red slippers", 10, 100011, 2, 5, new ArrayList<ItemAttribute>());
                p.addItem(b1);
                List<ItemAttribute> att6 = new ArrayList<ItemAttribute>();
                att6.add(new ItemAttribute(ItemAttributeType.MAXHP, 100));
                att6.add(new ItemAttribute(ItemAttributeType.MOVEMENT, 500));
                att6.add(new ItemAttribute(ItemAttributeType.LIFESTEAL, 0.1));
                p.addItem(new Boots("boots of poon", 1000, 100012, 50,50, att6));
                p.addItem(new Boots("steel boots", 25, 100013, 25, 5, new ArrayList<ItemAttribute>()));
                
                p.addItem(new ChestArmor("golden armor", 10000, 100014, 50, 20, new ArrayList<ItemAttribute>()));
                p.addItem(new ChestArmor("silver armor", 5000, 100018, 35, 10, new ArrayList<ItemAttribute>()));
                p.addItem(new ChestArmor("leather armor", 100, 100015, 20, 5, new ArrayList<ItemAttribute>()));;
                p.addItem(new Helmet("sapphire crown", 7500, 100016, 20, 5, new ArrayList<ItemAttribute>()));
                p.addItem(new Necklace("tooth chain necklace", 200, 100017, 2, 3, new ArrayList<ItemAttribute>()));
                p.addItem(new RangedWeapon("simple bow", 100, 100019, 50, 0, 0, 100, true, new ArrayList<ItemAttribute>()));
            }
            else
            {
                Item i = new Item("unwearable helmet", 10, 100000);
                p.addItem(i);
            }
        }
        
        Color[] p1col = {
            new Color(255,0,0),
            new Color(255,0,0),
            new Color(0,255,0),
            new Color(0,255,0)
        };
        p.setColoring(p1col);
        Color[] p2col = {
            new Color(0,255,0),
            new Color(0,255,0),
            new Color(255,0,0),
            new Color(255,0,0)
        };
        p1.setColoring(p2col);
        Color[] p3col = {
            new Color(255,0,255),
            new Color(255,0,255),
            new Color(0,255,0),
            new Color(0,255,0)
        };
        p2.setColoring(p3col);
        
        Color[] pfffcol = {
            new Color(255,0,255),
            new Color(255,0,255),
            new Color(0,255,0),
            new Color(0,255,0)
        };
        Player pfff = new Player("ffffff");
        pfff.setColoring(pfffcol);
        
        
        users.add(jeff);
        users.add(joff);
        
        User jiff = new User("f", "f", "f", "f", "f");
        jiff.addPlayer(pfff);
        jiff.setSelectedPlayerIndex(0);
        User darron = new User("d", "d", "d", "d", "d");
        users.add(jiff);
        users.add(darron);
    }
    
    public List<User> getUsers(){
        return users;
    }
}
